#!/usr/bin/env python

import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun


test = TestRun(__file__, sys.argv)

mc = Filter()
mc.add(string = 'Final MC-SRDFT energy',
      rel_tolerance = 1.0e-7)
mc.add(string = '-<< FC H 001 ; FC H 001 >>',
      rel_tolerance = 2.0e-4)
mc.add(string = '-<< FC H 001 ; FC H 002 >>',
      rel_tolerance = 2.0e-4)
mc.add(string = '-<< FC H 002 ; FC H 002 >>',
      rel_tolerance = 2.0e-4)
mc_lih = Filter()
mc_lih.add(string = 'Final MC-SRDFT energy',
      rel_tolerance = 1.0e-7)
mc_lih.add(string = '-<< FC Li001 ; FC Li001 >>',
      rel_tolerance = 2.0e-4)
mc_lih.add(string = '-<< FC Li001 ; FC H 002 >>',
      rel_tolerance = 2.0e-4)
mc_lih.add(string = '-<< FC H 002 ; FC H 002 >>',
      rel_tolerance = 2.0e-4)
    
test.run(['mcsrPBE_mu_04_fermi_nosym.dal'],
          ['h2_nosym.mol'],
          f={'out': mc})
test.run(['mcsrPBE_mu04_fermi.dal',
          'mcsrLDA_mu04_fermi.dal',
          'mcsrTPSS_mu04_fermi.dal'],
          ['lih.mol'],
          f={'out': mc_lih})
sys.exit(test.return_code)
